package com.bz.portal.controller;

import com.bz.portal.service.ItemService;
import com.bz.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/frontend/item")
public class ItemController {

    @Autowired
    private ItemService itemService;

    /**
     * 查询商品基本信息
     * @param itemId
     * @return
     */
    @GetMapping("/selectItemInfo")
    public Result selectItemInfo(Long itemId){
        return itemService.selectItemInfo(itemId);
    }

    /**
     * 查询商品描述
     * @param itemId
     * @return
     */
    @GetMapping("/selectItemDescByItemId")
    public Result selectItemDescByItemId(Long itemId){
        return itemService.selectItemDescByItemId(itemId);
    }

    /**
     * 根据商品ID查询商品规格参数
     * @param itemId
     * @return
     */
    @GetMapping("/selectTbItemParamItemByItemId")
    public Result selectTbItemParamItemByItemId(Long itemId){
        return itemService.selectTbItemParamItemByItemId(itemId);
    }
}
